package com.ylesb.aop;
/**
 * @title: Test
 * @projectName springdemo
 * @description: TODO
 * @author White
 * @site : [www.ylesb.com]
 * @date 2022/7/715:09
 */

import com.ylesb.aop.service.MyCalculator;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @className    : Test
 * @description  : [描述说明该类的功能]  
 * @author       : [XuGuangchao]
 * @site         : [www.ylesb.com]
 * @version      : [v1.0]
 * @createTime   : [2022/7/7 15:09]
 * @updateUser   : [XuGuangchao]
 * @updateTime   : [2022/7/7 15:09]
 * @updateRemark : [描述说明本次修改内容] 
 */

public class Test {
    public static void main(String[] args) {
            //五种通知
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig.class);
        MyCalculator myCalculator = ctx.getBean(MyCalculator.class);
        myCalculator.add(1,6);


        //动态代理
        //MyCalculatorImpl myCalculatorImpl = new MyCalculatorImpl();
        //MyCalculator myCalculator = (MyCalculator)CalculatorProxy.getInstance(myCalculatorImpl);
        //int sum = myCalculator.add(1, 5);
        //System.out.println("sum = " + sum);

    }
}
